import { types } from "mobx-state-tree";

const CountStore = types
  .model({
    count: types.number,
  })
  .views((self) => ({
    get double() {
      return self.count * 2;
    },
  }))
  .actions((self) => ({
    increment() {
      self.count += 1;
    },
    decrement() {
      self.count -= 1;
    },
  }));

export default CountStore;
